WPS Office.apk(点击下载) / nxs.java


package defpackage;

import android.support.v4.view.ViewCompat;
import com.google.firebase.analytics.FirebaseAnalytics;
import defpackage.nyf;
import org.xml.sax.Attributes;

/* access modifiers changed from: package-private */
/* renamed from: nxs  reason: default package */
public abstract class nxs {
    private static final String TAG = null;
    protected String ckE;
    protected Boolean qiP;
    protected String qiy;
    protected String qjD;
    protected String qjE;
    private boolean qjy;
    protected String qkb;
    protected String qkc;
    protected String qkd;
    protected String qke;
    protected String qkf;
    protected String qkg;
    protected String qkh;
    protected String qki;
    protected String qkj;
    protected String qkk;
    protected String qkl;
    protected String qkm;
    protected Boolean qkn;
    protected Boolean qko;
    protected Boolean qkp;
    private ewc qkq;

    public nxs(ewc ewc) {
        this.qkq = ewc;
    }

    private static int Mw(String str) {
        if ("none".equals(str)) {
            return 0;
        }
        if ("block".equals(str)) {
            return 1;
        }
        if ("classic".equals(str)) {
            return 2;
        }
        if ("diamond".equals(str)) {
            return 3;
        }
        if ("oval".equals(str)) {
            return 4;
        }
        if ("open".equals(str)) {
            return 5;
        }
        ew.eI();
        return 0;
    }

    private static int Mx(String str) {
        if ("narrow".equals(str)) {
            return 0;
        }
        if (FirebaseAnalytics.Param.MEDIUM.equals(str)) {
            return 1;
        }
        if ("wide".equals(str)) {
            return 2;
        }
        ew.eI();
        return 1;
    }

    private static int My(String str) {
        if ("short".equals(str)) {
            return 0;
        }
        if (FirebaseAnalytics.Param.MEDIUM.equals(str)) {
            return 1;
        }
        if ("long".equals(str)) {
            return 2;
        }
        ew.eI();
        return 1;
    }

    private static ewb c(ewb ewb) {
        ewb bmP = ewb != null ? ewb.clone() : ewb;
        return bmP == null ? new ewb() : bmP;
    }

    /* access modifiers changed from: package-private */
    public final void a(boolean z, ewc ewc) {
        int i;
        int i2;
        int i3;
        int i4 = 0;
        ew.assertNotNull("line should not be null", ewc);
        this.qjy = z;
        k(ewc);
        l(ewc);
        if (this.qjD != null) {
            Integer Mu = nxa.Mu(this.qjD);
            ew.eK();
            if (Mu != null) {
                ewc.te(Mu.intValue());
            } else if (this.qjy) {
                ewc.te(ViewCompat.MEASURED_SIZE_MASK);
            }
        }
        if (this.qjE != null) {
            Float a = npb.a(new gh(this.qjE));
            if (a != null) {
                ewc.cc(npb.eQ(a.floatValue()));
            } else if (this.qjy) {
                ewc.cc(0.0f);
            }
        }
        m(ewc);
        if (this.qkc != null) {
            String str = this.qkc;
            if ("single".equals(str)) {
                i3 = 0;
            } else if ("thinThin".equals(str)) {
                i3 = 1;
            } else if ("thinThick".equals(str)) {
                i3 = 3;
            } else if ("thickThin".equals(str)) {
                i3 = 2;
            } else if ("thickBetweenThin".equals(str)) {
                i3 = 4;
            } else {
                ew.eI();
                i3 = 0;
            }
            ewc.tv(i3);
        }
        if (this.qkd != null) {
            Integer Ms = nxa.Ms(this.qkd);
            if (Ms != null) {
                ewc.tw(Ms.intValue());
            } else {
                float[] Mt = nxa.Mt(this.qkd);
                if (Mt != null && Mt.length > 0) {
                    ewc.tw(0);
                    ewc.m(Mt);
                }
            }
        }
        if (this.qkf != null) {
            String str2 = this.qkf;
            if ("flat".equals(str2)) {
                i2 = 2;
            } else if ("square".equals(str2)) {
                i2 = 1;
            } else if ("round".equals(str2)) {
                i2 = 0;
            } else {
                ew.eI();
                i2 = 2;
            }
            ewc.ty(i2);
        }
        if (this.qke != null) {
            String str3 = this.qke;
            if ("round".equals(str3)) {
                i = 2;
            } else if ("bevel".equals(str3)) {
                i = 0;
            } else if ("miter".equals(str3)) {
                i = 1;
            } else {
                ew.eI();
                i = 2;
            }
            ewc.tx(i);
        }
        if (!(this.qkg == null && this.qki == null && this.qkj == null)) {
            ewb c = c(ewc.bna());
            if (this.qkg != null) {
                c.head = Mw(this.qkg);
            }
            if (this.qki != null) {
                c.width = Mx(this.qki);
            }
            if (this.qkj != null) {
                c.len = My(this.qkj);
            }
            ewc.b(c);
        }
        if (!(this.qkk == null && this.qkl == null && this.qkm == null)) {
            ewb c2 = c(ewc.bmZ());
            if (this.qkk != null) {
                c2.head = Mw(this.qkk);
            }
            if (this.qkl != null) {
                c2.width = Mx(this.qkl);
            }
            if (this.qkm != null) {
                c2.len = My(this.qkm);
            }
            ewc.a(c2);
        }
        if (this.qkh != null) {
            String str4 = this.qkh;
            if (!"solid".equals(str4)) {
                if ("pattern".equals(str4)) {
                    i4 = 1;
                } else if ("tile".equals(str4)) {
                    i4 = 2;
                } else if ("frame".equals(str4)) {
                    i4 = 3;
                } else {
                    ew.eI();
                }
            }
            ewc.setType(i4);
        }
        n(ewc);
        if (this.qko != null) {
            ewc.eWn.setBoolean(576, this.qko.booleanValue());
        }
        if (this.qkp != null) {
            ewc.jU(this.qkp.booleanValue());
        }
    }

    public void bN(Attributes attributes) {
        if (attributes != null) {
            this.ckE = aayw.a(attributes, "id", "http://schemas.openxmlformats.org/officeDocument/2006/relationships");
            this.qiP = aayw.b(attributes, "on", "");
            this.qiy = aayw.a(attributes, "color", "");
            this.qjD = aayw.a(attributes, "color2", "");
            this.qjE = aayw.a(attributes, "opacity", "");
            this.qkb = aayw.a(attributes, "weight", "");
            this.qkc = aayw.a(attributes, "linestyle", "");
            this.qkd = aayw.a(attributes, "dashstyle", "");
            this.qke = aayw.a(attributes, "joinstyle", "");
            this.qkf = aayw.a(attributes, "endcap", "");
            this.qkg = aayw.a(attributes, "endarrow", "");
            this.qki = aayw.a(attributes, "endarrowwidth", "");
            this.qkj = aayw.a(attributes, "endarrowlength", "");
            this.qkk = aayw.a(attributes, "startarrow", "");
            this.qkl = aayw.a(attributes, "startarrowwidth", "");
            this.qkm = aayw.a(attributes, "startarrowlength", "");
            this.qkh = aayw.a(attributes, "filltype", "");
            this.qkn = aayw.b(attributes, "insetpen", "");
            this.qko = aayw.b(attributes, "forcedash", "urn:schemas-microsoft-com:office:office");
            this.qkp = aayw.b(attributes, "imagealignshape", "");
        }
    }

    /* access modifiers changed from: protected */
    public abstract boolean edy();

    /* access modifiers changed from: protected */
    public void k(ewc ewc) {
        if (this.qiP != null) {
            ewc.jQ(this.qiP.booleanValue());
        } else if (this.qjy) {
            ewc.jQ(edy());
        }
    }

    /* access modifiers changed from: protected */
    public void l(ewc ewc) {
        if (this.qiy != null) {
            Integer Mu = nxa.Mu(this.qiy);
            ew.eK();
            if (Mu != null) {
                ewc.setColor(Mu.intValue());
            } else if (this.qjy) {
                ewc.setColor(0);
            }
        }
    }

    /* access modifiers changed from: protected */
    public void m(ewc ewc) {
        float floatValue;
        if (this.qkb != null) {
            nyf nyf = new nyf(this.qkb);
            nyf.a aVar = nyf.a.PT;
            if (nyf.Dd == null) {
                floatValue = 0.75f;
                aVar = nyf.a.PT;
            } else {
                floatValue = nyf.Dd.floatValue();
                if (nyf.qlL != null) {
                    aVar = nyf.qlL;
                }
            }
            switch (aVar) {
                case PT:
                    break;
                case EMU:
                    floatValue = fh.G(floatValue);
                    break;
                case MM:
                    floatValue = fh.L(floatValue);
                    break;
                case CM:
                    floatValue = fh.M(floatValue);
                    break;
                case IN:
                    floatValue *= 72.0f;
                    break;
                case PI:
                case PC:
                    floatValue = fh.O(floatValue);
                    break;
                default:
                    new StringBuilder("A unit has not been processed: ").append(nyf.qlL);
                    ew.eI();
                    break;
            }
            ewc.setWidth(floatValue);
        }
    }

    /* access modifiers changed from: protected */
    public void n(ewc ewc) {
        if (this.qkn != null) {
            ewc.jS(this.qkn.booleanValue());
        }
    }

    /* access modifiers changed from: protected */
    public final ewc yo() {
        if (this.qkq != null) {
            try {
                return this.qkq.clone();
            } catch (CloneNotSupportedException e) {
                hm.e(TAG, "CloneNotSupportedException", e);
            }
        }
        return new ewc();
    }
}